Flipbooks present code step-by-step and side-by-side with its output. The incremental code/result reveal may help you digest longer manipulation and analysis pipelines as well as plot builds. Two of their attractive features is the incrementalism and the movie-like presentation.
Long pipelines of code can produce attractive outputs. But when an observer knows only initial input and final output, a pipeline may feel like a long stretch of highway that has no exit or entry ramps. Interacting with the same code that has been made into a flipbook is designed to give users a lot of entry and exit ramps; in a flipbook the user can isolate and gain insight about short streches along the pipeline that are useful for their particular project – all the while engaged by the creativity brought by the author in pursuit of their original goal. Flipbooks enable us to isolate how individual functions work in context.
The presentation of intermediate states on via slide-show presentation platform means that states can be aligned and superimposed. This way, the audience doesn’t need to engage in visual search which requires focus and concentration – but rather effortlessly observes changes as motion detection. Temporal rather than spatial offset makes it easy to notice changes to the code and the resultant changes to the output.
To get a sense of how they work, click once in the example box the below to initiate the session; then use the right and left arrow to “flip” through the book to see how to make an animated “racing” bar chart of the population size of the most populous countries over time.
I’ve sorted the flipook I’ve created into three categories. You can link to a able of contents from here:
You can link some flipbooks here:
If you need a theoretical exploration of the grammar of graphics and its use with ggplot2, see a ggplot2 grammar guide.
The geom pile on is a suppliment to the ggplot grammar guide and shows you a lot of “geoms” that you can use to communicate about your data. Piling up the geoms allows you to see how plot types relate to one another.
ggplot themes takes you through logic of the ggplot2 theme adjustments.
For examples of data wrangling/manipulation with pipelines and pipes (%>%), check out The Tidyverse in Action.
geom_sf gives you an example of using geom_sf with ggplot to create coordinate plots and choropleths.
ggtext gives you an example of the how the new ggtext package can be used; this example by Klaus Schulte.
the data cleaning flipbook gives you some life-changing, magical, and real-life examples of reading data into R and cleaning it (aka “tidying up”). Demonstrates uses of {janitor}, {countrycode}, and {lubridate} as well as regex with {stringr}.
the ggplot flipbook is a gallery example plots built using ggplot2.